package com.bluesmart.mia;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.util.ImageLoaderHelper;

import android.graphics.Color;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;
import android.widget.TextView;

public class FamilyInfoActivity extends BaseActivity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_family_info);

		((TextView) findViewById(R.id.center)).setTextColor(Color.WHITE);
		((TextView) findViewById(R.id.center)).setText(getString(R.string.caregivers));
		
		JSONObject obj = JSON.parseObject(getIntent().getStringExtra("info"));
		
		try{
			obj = obj.getJSONArray("caregiverlist").getJSONObject(0);
		}
		catch(Exception e){}
		
		((TextView)findViewById(R.id.text0)).setText(obj.getString("caregiverName"));
		((TextView)findViewById(R.id.text1)).setText(obj.getString("caregiverNickName"));
		((TextView)findViewById(R.id.text2)).setText(obj.getString("caregiverRole"));

        ImageLoaderHelper.displayImage(R.drawable.a37, (ImageView)findViewById(R.id.icon), 
        		obj.getString("caregiverUserImg"));
        
        findViewById(R.id.left).setOnClickListener(new OnClickListener()
        {
			@Override
			public void onClick(View arg0) {
				finish();
			}
        });
	}
}
